//
//  BackPasswordViewController.m
//  Diary
//
//  Created by lanou3g on 16/1/21.
//  Copyright © 2016年 lanou3g. All rights reserved.
//

#import "BackPasswordViewController.h"

@interface BackPasswordViewController ()

@end

@implementation BackPasswordViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    
    
    //通知修改字数
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(testing) name:UITextFieldTextDidChangeNotification object:nil];
    _saveButton.enabled = NO;
    
}

//保存数据
- (IBAction)saveButton:(id)sender {
    [_passwordFT resignFirstResponder];
    
    NSString *pasStr = _passwordFT.text;
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    [userDefaults setObject:pasStr forKey:@"pasStr"];
    
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)testing{
    
    if (_passwordFT.text.length >= 1) {
        
        _saveButton.enabled = YES;
        
    }else{
        
        _saveButton.enabled = NO;
    }
    
}



@end
